<template>
  <view>
    <view class="goods-container">
      <view class="goods-left">
        <image :src="item.goods_small_logo || defaultPic" class="goods-img"></image>
      </view>
      <view class="goods-right">
        <view class="goods-name">{{item.goods_name}}</view>
        <view class="goods-price">￥{{item.goods_price | toFixed}}</view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-goods",
    props:{
      item:{
        type: Object,
        default: {}
      }
    },
    filters:{
      toFixed(val){
        return Number(val).toFixed((2))
      }
    },
    data() {
      return {
        
        defaultPic: 'https://img3.doubanio.com/f/movie/8dd0c794499fe925ae2ae89ee30cd225750457b4/pics/movie/celebrity-default-medium.png'
      };
    }
  }
</script>

<style lang="scss">
  .goods-container{
    display: flex;
    padding: 5px;
    background-color: #fff;
    border-bottom: 1px solid #efefef;
    .goods-left{
      .goods-img{
        display: block;
        width: 100px;
        height: 100px;
      }
    }
    .goods-right{
      padding-left: 10px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .goods-name {
        font-size: 13px;
      }
      .goods-price {
        font-size: 16px;
        color: #c00000;
      }
    }
  }
</style>